home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 010 / trek.arc / TREKFINE.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1985-03-24  |  8.0 KB  |  157 lines

  1. 100  DEFINT A-Z
  2. 110  COMMON SP,FIN,D!,RK,RC,RB,RR!,RT!,KST,KB,KK,KC,G(),CX(),CY(),BX(),BY()
  3. 120  COMMON NS(),P(),UX,UY,RS,KR,RR,KS,CR,KP,Q(),KX(),KY(),KP!(),KA!(),KD!()
  4. 130  COMMON NK,NB,NR!,NC,NT!,NST,NE!,NSH!,NT,NL!,ND!,E!,S!,SU,C,T,S$
  5. 140  COMMON QX,QY,SX,SY,W!,WS!,L!,D!(),LN,S,P$,DS!,DR!,H!,T!,BX,BY,DF!
  6. 150  COMMON HK,KC,CS,NH,NKN,S(),F!(),GO,G1,A,JI,R,AD,DF!,SC,TX,TY,ND,PX,PY,O
  7. 160  COMMON LD,P,MN,NP,HE,HS,NZ,HR,CF,SN,CG,SB,SE,CP!,CT,DB,BAX,BAY,CR!(),DO,IN$
  8. 400  ZZZY=RND(1)*RND(1)*RND(1)*100 MOD 97:RANDOMIZE ZZZY
  9. 500  IF FIN=0 THEN GOTO 600
  10. 505  PRINT:PRINT:PRINT:PRINT "It is stardate ";:PRINT USING "####.#";D!;:PRINT ".":PRINT
  11. 510  ON FIN GOSUB 1000,1200,1240,1290,1320,1350,1380,1420,1450,1480,1510,1540,1570,1600,1640,1670,1710,1750,1780,1810,1840
  12. 520  IF (FIN>=3 AND FIN<=5) OR FIN>=7 THEN GOSUB 1900
  13. 550  GOSUB 2000:'score
  14. 600  PRINT STRING$(79,"*")
  15. 605  I$=INKEY$:IF I$<>"" THEN 605
  16. 610  PRINT "Would you like to play again ? ";
  17. 620  I$=INKEY$:IF I$="" THEN 620
  18. 630  IF I$="Y" OR I$="y" THEN PRINT "Yes":CLEAR:RUN "TREKINIT" ELSE PRINT "No"
  19. 650  SYSTEM
  20. 1000  'game won
  21. 1010  IF RR<>0 THEN PRINT "The remaining"RR"Romulans surrender to starfleet command.":PRINT
  22. 1020  PRINT "You have smashed the Klingon invasion fleet and saved the Federation."
  23. 1030  G1=1:IF A=0 OR KB<>0 OR LEFT$(S$,1)<>"E" OR 5*KST+CS+10*KP+45*NH>=100 THEN 1180
  24. 1040  IF D!-ND!<5 THEN 1060
  25. 1050  RATEMX!=0.1*S*(S+1)+0.1:PERDTE!=(KK+KC+KS)/(D!-ND!):IF PERDTE!<RATEMX! THEN 1180
  26. 1060  PRINT:PRINT "In fact, you have done so well that Starfleet Command ";
  27. 1070  IF S=4 THEN 1110 ELSE IF S=5 THEN 1120
  28. 1080  PRINT "promotes you one step in":PRINT "rank from ";
  29. 1090  IF S=1 THEN PRINT "'Novice' to 'Fair'"; ELSE IF S=2 THEN PRINT "'Fair' to 'Good'"; ELSE PRINT "'Good' to 'Expert'";
  30. 1100  PRINT " ... CONGRATULATIONS !":GOTO 1180
  31. 1110  PRINT "promotes you to":PRINT "  Commodore Emeritus.":PRINT:PRINT "Now that you think you're really good,  try playing the 'Emeritus'":PRINT "game.     It will splatter your ego !":GOTO 1180
  32. 1120  DLY=100:GOSUB 1870:PRINT:PRINT "Computer:  ERROR-ERROR-ERROR-ERROR":PRINT "YOUR SKILL HAS EXCEEDED THE CAPACITY OF THES PROGRAM."
  33. 1130  MSG$="THIS PROGRAM MUST SURVIVE":FOR I=1 TO 3:DLY=80*I:GOSUB 1870:PRINT MSG$:NEXT I
  34. 1140  ML=LEN(MSG$):FOR I=1 TO ML:PRINT MID$(MSG$,I,1);:DLY=RND(1)*80:GOSUB 1870:IF I>0.75*ML THEN PRINT SPACE$((10+I-ML)*RND(1));
  35. 1150  NEXT I
  36. 1160  DLY=400:GOSUB 1870
  37. 1170  PRINT "Now you can retire and write your own Star Trek game.":
  38. 1180  PRINT:PRINT "Live long and prosper."
  39. 1190  RETURN
  40. 1200  'time run out
  41. 1210  PRINT "Your time has run out,  and the Federation has been conquered.  Your starship":PRINT "is now Klingon property,  and you are put on trial as a war criminal.  On the":PRINT "basis of your record you are ";
  42. 1220  IF RK*3>NK THEN PRINT "acquitted.":PRINT:PRINT "Live long and prosper." ELSE PRINT "found guilty and sentenced to death by slow":PRINT "torture.":A=0
  43. 1230  RETURN
  44. 1240  'life support system failure
  45. 1250  PRINT "Your life support reserves have run out."
  46. 1260  PRINT "You die of thirst, starvation and asphyxiation."
  47. 1270  PRINT "Your starship is a derelict in space."
  48. 1280  RETURN
  49. 1290  'energy supply exhausted
  50. 1300  PRINT "Your energy supply is exhausted":GOTO 1260
  51. 1310  RETURN
  52. 1320  'defeated in battle
  53. 1330  PRINT "The "S$" has been destroyed in battle.":PRINT:PRINT "Dulce et decorum est pro patria mori."
  54. 1340  RETURN
  55. 1350  'hit -energy barrier 3 times
  56. 1360  PRINT "You have made three attempts to cross the negative energy barrier which":PRINT "surrounds the galaxy.":PRINT:PRINT "Your navigation is abominable."
  57. 1370  RETURN
  58. 1380  'starship destroyed by ordinary nova
  59. 1390  PRINT "Your starship has been destroyed by a nova."
  60. 1400  PRINT "That was a great shot !!!"
  61. 1410  RETURN
  62. 1420  'starship destroyed by super nova
  63. 1430  PRINT "The "S$" has been fried by a supernova.":PRINT "...NOT EVEN CINDERS REMAIN..."
  64. 1440  RETURN
  65. 1450  'abandon ship when no starbases
  66. 1460  PRINT "You have been captured by the Klingons.  If you still had a starbase to be":PRINT "returned to, you would have been repatriated and given another chance.":PRINT "Since you have no starbases,  you will be mercilessly tortured to death.":A=0
  67. 1470   RETURN
  68. 1480  'starship self-destruct or dilithium crystals explode
  69. 1490  PRINT "Your starship is now an expanding cloud of subatomic particles."
  70. 1500  RETURN
  71. 1510  'failed to re-materialize after calling for help
  72. 1520  PRINT "Starbase was unable to re-materialize your starship."
  73. 1530  RETURN
  74. 1540  'starship phasers itself
  75. 1550  PRINT "The "S$" has been creamated by its own phasers."
  76. 1560  RETURN
  77. 1570  'captain lost in transporter beam
  78. 1580  PRINT "You and your landing party have been converted to energy,  dissipating":PRINT "through space.":GOTO 1620
  79. 1590  RETURN
  80. 1600  'mining party left on planet after tractor beam
  81. 1610  PRINT "You are left with your landing party on a wild jungle planet inhabited by":PRINT "primitave cannibals.":PRINT:PRINT "They are very fond of 'Captain Kirk' soup."
  82. 1620  PRINT:PRINT "Without your leadership, the "S$" is destroyed."
  83. 1630  RETURN
  84. 1640  'starship destroys planet with mining party on it
  85. 1650  PRINT "You and your mining party perish.":GOTO 1400
  86. 1660  RETURN
  87. 1670  'Kirk fried by nova on planet surface
  88. 1680  PRINT "You and your mining party are instantly atomized."
  89. 1690  PRINT "Mr. Spock takes command of the "S$" and joins the Romulans, reigning":PRINT "terror on the federation."
  90. 1700  RETURN
  91. 1710  'Kirk fried by supernova in shuttle craft
  92. 1720  PRINT "Galileo is instantly annihilated by the supernova."
  93. 1730  TO TO 16000
  94. 1740  RETURN
  95. 1750  'shuttle craft caught in tractor beam
  96. 1760  PRINT "Shuttle craft Galileo is also caught, and breaks up under the strain.":PRINT:PRINT "Your debris is scattered for millions of miles.":GOTO 1620
  97. 1770  RETURN
  98. 1780  'deathray converts crew into mutants
  99. 1790  PRINT "The mutants attack and kill Spock.  Your ship is captured by Klingons, and":PRINT:PRINT "your crew is put on display in a Klingon zoo."
  100. 1800  RETURN
  101. 1810  'tribble trouble
  102. 1820  PRINT "Tribbles consume all remaining water, food and oxygen on your ship.":GOTO 1260
  103. 1830  RETURN
  104. 1840  'black hole swallows ship
  105. 1850  PRINT "Your ship is drawn to the center of the black hole.  You are crushed into":PRINT "extremely dense matter."
  106. 1860  RETURN
  107. 1870  'DELAY
  108. 1880  FOR DLYI=1 TO DLY:FOR DLYJ=1 TO 1:NEXT DLYJ,DLYI:RETURN
  109. 1900  PRINT:IF LEFT$(S$,1)="F" THEN S$="" ELSE IF LEFT$(S$,1)="E" THEN S$="Faire queen"
  110. 1905  A=0:IF RK=0 THEN 1950
  111. 1910  GOODYS!=RR!/NR!:BADDYS!=(RK+2*RC)/(NK+2/NC):ADVNTG!=GOODYS!/BADDYS!
  112. 1915  IF ADVNTG!<1+0.5*RND(1) THEN 1940
  113. 1920  PRINT "As a result of your actions,  a treaty with the Klingon Empire has been":PRINT "signed.  The terms of the treaty are ";
  114. 1925  IF ADVNTG!<3+RND(1) THEN 1935
  115. 1930  PRINT "favorable to the Federation.":PRINT:PRINT "CONGRATULATIONS.":RETURN
  116. 1935  PRINT "highly unfavorable to the Federation.":RETURN
  117. 1940  PRINT "The Federation will be destroyed."
  118. 1945  RETURN
  119. 1950  PRINT "Since you took the last Klingon with you, you are a martyr and a hero.":PRINT "Someday maybe they'll erect a statue in your memory.  Rest in peace, and try":PRINT "not to think about pigeons.":G1=1:A=0
  120. 1955  RETURN
  121. 2000  ' score
  122. 2005  I$=INKEY$:IF I$<>"" THEN 2005
  123. 2010  PRINT:PRINT "=====> Press any key for score";
  124. 2020  I$=INKEY$:IF I$="" THEN 2020 ELSE LOCATE ,1:PRINT SPACE$(79);:LOCATE ,1
  125. 2030  TIMUSD!=D!-ND!:IF TIMUSD!=0 OR RK<>0 THEN IF TIMUSD!<5 THEN TIMUSD!=5
  126. 2040  PERDTE!=(KC+KK+KS)/TIMUSD!:ITHPRD=500*PERDTE!:IWON=0
  127. 2050  IF G1<>0 THEN IWON=100*S
  128. 2060  IF LEFT$(S$,1)="E" THEN KLSHIP=0 ELSE IF LEFT$(S$,1)="F" THEN KLSHIP=1 ELSE KLSHIP=2
  129. 2070  IDIED=0:IF A=0 THEN IDIED=200
  130. 2080  IF G1=0 THEN RR=0
  131. 2090  ISCORE=10*KK+50*KC+ITHPRD+IWON-IDIED-100*KB-100*KLSHIP-45*NH-5*KST-CS+20*KR+200*KS-10*KP+RR
  132. 2100  PRINT:PRINT "Your score--"
  133. 2110  IF KR<>0 THEN MSG$="Romulan(s) destroyed":SCR=20*KR:AMT=KR:GOSUB 5000
  134. 2120  IF RR<>0 THEN MSG$="Romulan(s) captured":SCR=RR:AMT=RR:GOSUB 5000
  135. 2130  IF KK<>0 THEN MSG$="Ordinary Klingon(s) destroyed":SCR=KK*10:AMT=KK:GOSUB 5000
  136. 2140  IF KC<>0 THEN MSG$="Klingon Commander(s) destroyed":SCR=50*KC:AMT=KC:GOSUB 5000
  137. 2150  IF KS<>0 THEN MSG$="Super-Commander destroyed":SCR=200:AMT=-1:GOSUB 5000
  138. 2160  IF ITHPRD<>0 THEN PRINT USING "###.# Klingons per stardate average";PERDTE!;:PRINT STRING$(54-POS(0),".");:PRINT USING "##,###";ITHPRD
  139. 2170  IF KST<>0 THEN MSG$="star(s) destroyed by your action":SCR=-5*KST:AMT=KST:GOSUB 5000
  140. 2180  IF KP<>0 THEN MSG$="planet(s) destroyed by your action":SCR=-10*KP:AMT=KP:GOSUB 5000
  141. 2190  IF KB<>0 THEN MSG$="base(s) destroyed by your action":SCR=-100*KB:AMT=KB:GOSUB 5000
  142. 2200  IF NH<>0 THEN MSG$="call(s) for help from starbase":SCR=-45*NH:AMT=NH:GOSUB 5000
  143. 2210  IF CS=0 THEN 2220
  144. 2212  IF CS=1 THEN MSG$="casualty incurred" ELSE MSG$="casualties incurred"
  145. 2214  SCR=-CS:AMT=CS:GOSUB 5000
  146. 2220  IF KLSHIP<>0 THEN MSG$="ship(s) lost or destroyed":SCR=-100*KLSHIP:AMT=KLSHIP:GOSUB 5000
  147. 2230  IF A=0 THEN MSG$="Penalty for getting yourself killed":SCR=-200:AMT=-1:GOSUB 5000
  148. 2240  IF G1=0 THEN 2250
  149. 2242  MSG$="Bonus for winning "
  150. 2244  IF S=1 THEN MSG$=MSG$+"novice" ELSE IF S=2 THEN MSG$=MSG$+"fair" ELSE IF S=3 THEN MSG$=MSG$+"good" ELSE IF S=4 THEN MSG$=MSG$+"expert" ELSE MSG$=MSG$+"emeritus"
  151. 2246  MSG$=MSG$+" game":AMT=-1:SCR=IWON:GOSUB 5000
  152. 2250  PRINT:MSG$="Total score":AMT=-1:SCR=ISCORE:GOSUB 5000
  153. 2290  RETURN
  154. 5000  'print score line
  155. 5010  IF AMT>0 THEN PRINT USING " ###";AMT;
  156. 5020  PRINT "  "MSG$;:PRINT STRING$(54-POS(0),".");:PRINT USING "##,###";SCR:RETURN
  157.